#include<stdio.h>

int main()
{
    int n=1357689;//1 357 689
    char s[100];
    sprintf(s,"00%d",n);
    int w=strlen(s)/3;
    char*p=s+strlen(s);
    int x,y,z;
    p-=w;
    sscanf(p,"%d",&z);
    *p=0;

    p-=w;
    sscanf(p,"%d",&y);
    *p=0;

    p-=w;
    sscanf(p,"%d",&x);
    printf("x=%d y=%d z=%d\n",x,y,z);
    printf("%d\n",x+z-y);

    return 0;



}
